import os, logging

from google.appengine.dist import use_library
use_library('django', '1.2')

from google.appengine.ext import webapp
from google.appengine.ext.webapp import template
from google.appengine.ext.webapp.util import run_wsgi_app

from app_settings import *

ROOT_PATH = os.path.dirname(__file__)
TEMPLATE = os.path.join(ROOT_PATH, 'templates')

class HomePage(webapp.RequestHandler):
    def get(self):
        page_path = os.path.join(TEMPLATE, 'index.html')
        template_values = {
                'title': title,
                'message': message,
                'site_url': site_url,
                'target_url': target_url,
                'comment1': comment1,
                'comment2': comment2,
                'comment3': comment3,
                'comment4': comment4,
                'comment5': comment5,
                'comment6': comment6
                }
        return self.response.out.write(template.render(page_path, template_values))

routes = [
        ('/', HomePage),
        ]
application = webapp.WSGIApplication(routes, debug=True)

def main():
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
